<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>年检</title>
		<meta name="renderer" content="webkit|ie-comp|ie-stand" />  
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" type="text/css" href="layui/css/layui.css" media="all">
		<link rel="stylesheet" type="text/css" href="css/index.css" />
	</head>

	<body>
		<section class="layui-larry-box">
			<div class="larry-personal">
				<div class="layui-tab">
					<blockquote class="layui-elem-quote mylog-info-tit" style="background: #fff;">
						<ul class="handle-box" id="enterprises">
							<li class="handle-item" >
								<span class="layui-form-label" style="float: left; line-height: 30px;">设备编号：</span>
								<div class="layui-input-inline" style="float: left;">
									<input type="text" v-model="deviceNo" autocomplete="off" placeholder="请输入设备编号" class="layui-input">
								</div>
								<span class="layui-form-label" style="float: left; line-height: 30px;">设备名称：</span>
								<div class="layui-input-inline" style="float: left;">
									<input type="text" v-model="deviceName" autocomplete="off" placeholder="请输入设备名称" class="layui-input">
								</div>
								<span class="layui-form-label" style="float: left; line-height: 30px;">年检年份：</span>
								<div class="layui-input-inline">
                                    <input type="text" v-model="inspectionYear" autocomplete="off" placeholder="请输入年份" class="layui-input">
                                </div>
                                <div class="layui-btn mgl-20" @click="enterpriseDemand">查询</div>
								<!--<button class="layui-btn mgl-20" id="refresh">刷新</button>-->
								<span class="fr">
									<a class="layui-btn btn-add btn-default" id="enterprise_add"><i class="linyer icon-add"></i> 添加记录</a>
								</span>
							</li>
						</ul>
					</blockquote>
					<div class="layui-clear">
						<div class="tableTools fr"></div>
					</div>
					<div class="layui-tab-item layui-field-box layui-show" style="position: relative;">
						<table class="table-box table-sort" id="enterprise" lay-even="" lay-skin="nob">
						</table>
					</div>
				</div>
			</div>
		</section>
		<script type="text/javascript" src="layui/layui.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<script type="text/javascript" src="js/inspection.js"></script>
		<script type="text/javascript" src="js/vue/vue.js"></script>
		<script src="//cdn.bootcss.com/jquery/3.2.0/jquery.js"></script>
		<script src="//cdn.bootcss.com/vue-resource/1.2.1/vue-resource.js"></script>
		<script type="text/javascript">
			var vue = new Vue({
                el: '#enterprises',
                data: {
                    deviceName: "",
                    deviceNo:"",
                    inspectionYear:"",
                },
                mounted: function () {
                    this.$nextTick(function () {

                    });
                },
                methods: {
                    enterpriseDemand: function () {
                    	//debugger;
                        var params = new Object();
                        params.pageSize = 999;
                        params.currentPage = 1;
                        if (this.deviceNo != "")
                        params.deviceNo = this.deviceNo;
                        if (this.inspectionYear != "")
                        params.inspectionYear = this.inspectionYear;
                        if (this.deviceName != "")
                        params.deviceName = this.deviceName;
                        var token=new Object();
                        token.accessToken=accessToken;
	                    	this.$http.get(url + '/ic-iot/users/'+adminId+'/devices/inspection',
	                            {params: params,headers:token}).then(function (response) {
	                        var res = response.body;
	                        if (res.code == 1) {
	                            var result = res.result;
	                            $('#enterprise').dataTable().fnClearTable();
	                            if (result.length != 0)
	                            $('#enterprise').dataTable().fnAddData(result);
	                        }
                        }).catch(function (response) {
                            console.log(response)
                        });
		            }
		        }
		    });
		</script>
	</body>

</html>